<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>공지사항</title>

<script type="text/javascript" src="/tour/js/jquery.js"></script>
<script type="text/javascript" src="/tour/js/jquery-ui.js"></script>
<link type="text/css" href="/tour/css/jquery-ui.css" rel="stylesheet">


<style type="text/css">

#container{
	width:1100px;
	
	margin:auto;/*센터로 정렬시킨다*/
}
#head{
	padding: 5px;
	height: 10px;
	text-align: right;	
	

}


#top{
	padding: 5px;
	text-align: center;	
	
	  /*border를 1px씩 주게 되면 width가 딱맞게 만들 경우 선때문에 outer공간이 모자라 모양이 깨진다.*/
}




#header{
	padding: 5px;
	text-align: center;	
/*	
	border:1px solid gray;
	*/
	  /*border를 1px씩 주게 되면 width가 딱맞게 만들 경우 선때문에 outer공간이 모자라 모양이 깨진다.*/
}



#left{
	padding: 5px;
	width:180px;/*height는 주지 않는다. 내용에 따라 늘어나도록 처리하기 위해*/
	float:left;/*경계선 때문에*/
	/*clear:both;*/
}

#content{
	padding: 5px;
	width:820px;/*height는 주지 않는다. 내용에 따라 늘어나도록 처리하기 위해*/
	float:left;/*경계선 때문에*/
	/*clear:both;*/
}






#footer{
	padding-top:5px;
	
	clear:both;  /*이것이 없으면 left, content 아래로 들어가 버린다.*/
	text-align:center;
	height:50px;
}
</style>
<script type="text/javascript">
function writer(){
	
}
</script>

<script type="text/javascript">
$(document).ready(function(){
	var fi=$("#finds").get(0);
	fi[0] = new Option("제목");fi[0].value="제목";
});
</script>

</head>
<body>
<div id="container" >
	
	<div id="head">
		<jsp:include page="/templates/header.jsp"/>
	</div>
	
	<div id="top">
		<jsp:include page="/templates/top.jsp"/>
	</div>
	

	<div id="header">
		<jsp:include page="/templates/top_menu.jsp"/>
	</div>



	<div id="left" >
		<jsp:include page="/templates/banner.jsp"/>
		
	</div>
	
		<div id="content" >
		
		<img src="/tour/images/main_img/메뉴공지사항.jpg" width="150"  border="0" />
		
		<table id="content" border="1" >
			<tr bgcolor="skyblue">
				<th width="65px">글번호</th>
				<th>제목</th>
				<th width="80px">작성자</th>
				<th width="60">작성일</th>
				<th width="60">조회수</th>
			</tr>
		<!-- --------------------------------게시물 목록---------------------------------------------- -->
		<!-- 
			게시물의 제목에 링크를 걸어 클릭시 그 글의 상세사항을 볼 수 있도록 한다.
			답변 글들의 제목은 답변의 level만큼 공백을 먼저 주고 답변이라는 것을 표시한다. (여기서는 '→' 사용)
		-->	
			<c:forEach items="${requestScope.list }" var="board">
				<tr>
					<td>${board.no }</td>
					<td>
						<c:forEach begin="1" end="${board.relevel }" step="1">
							&nbsp;&nbsp;
						</c:forEach>
						<c:if test="${board.relevel != 0 }">
							→
						</c:if>
						<a href="/tour/board/getContent.do?no=${board.no }&page=${requestScope.pagingBean.currentPage}">
							${board.title }
						</a>
					</td>
					<td>${board.writer }</td>
					<td>${board.writedate }</td>
					<td>${board.viewcount }</td>
				</tr>	
			</c:forEach>
		<!-- --------------------------------게시물 목록---------------------------------------------- -->	
		</table>
		<p>
		<!-- --------------------------------페이징 처리---------------------------------------------- -->
		<table align="center">
			<tr>
				<td>		
				<c:choose>
					<c:when test="${requestScope.pagingBean.previousPageGroup }">
						<a href="/tour/board/list.do?page=${requestScope.pagingBean.startPageOfPageGroup -1 }">
						◀
						</a>
					</c:when>
					<c:otherwise>
						◀
					</c:otherwise>
				</c:choose>
				<c:forEach begin="${requestScope.pagingBean.startPageOfPageGroup }"
									   end="${requestScope.pagingBean.endPageOfPageGroup }"
									   step="1"
									   var ="i">
					<c:choose>
						<c:when test="${i == requestScope.pagingBean.currentPage }">
							${i }
						</c:when>
						<c:otherwise>
							<a href="/tour/board/list.do?page=${i }">${i }</a>
						</c:otherwise>
					</c:choose>			
				</c:forEach>
				<c:choose>
					<c:when test="${requestScope.pagingBean.nextPageGroup }">
						<a href="/tour/board/list.do?page=${requestScope.pagingBean.endPageOfPageGroup + 1 }">
							▶
						</a>
					</c:when>
					<c:otherwise>
						▶
					</c:otherwise>
				</c:choose>
				
				<td>
			</tr>
		</table>
		<!-- --------------------------------페이징 처리---------------------------------------------- -->
		<c:choose>
		<c:when test="${sessionScope.member.custName=='관리자' }">
		<input type="button" value="글쓰기" onclick="location.href='/tour/board/write_form.do'">
		</c:when>
		</c:choose>
		<br>
		<form method="post" action="/tour/board/find.do">
		<select id="finds" name="finds">
			<option value="defualt"/>
		</select> 
		<input type="text" name="find" >
		
		<input type="submit" value="검색">
		
		</form>
		
		
</div>

	<div id="footer" >
		<jsp:include page="/templates/footer.jsp"/>
	</div>
</div>


</body>
</html>















